home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / OpenTransport / Interfaces / CIncludes / OpenTptDevLinks.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-24  |  2.6 KB  |  121 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        OpenTptDevLinks.h
  3.  
  4.     Contains:    Link related constants and structures
  5.  
  6.     Copyright:    © 1993-1995 by Apple Computer, Inc., all rights reserved.
  7.  
  8.  
  9. */
  10.  
  11. #ifndef __OPENTPTDEVLINKS__
  12. #define __OPENTPTDEVLINKS__
  13.  
  14. #ifndef __OPENTPTLINKS__
  15. #include <OpenTptLinks.h>
  16. #endif
  17.  
  18. #ifndef __OPENTPTCOMMON__
  19. #include <OpenTptCommon.h>
  20. #endif
  21.  
  22. #if PRAGMA_ALIGN_SUPPORTED
  23. #pragma options align=mac68k
  24. #endif
  25.  
  26. /*******************************************************************************
  27. ** Link related constants
  28. ********************************************************************************/
  29.  
  30. enum
  31. {
  32.     kEnetPacketHeaderLength        = (2*k48BitAddrLength)+k8022DLSAPLength,
  33.     //
  34.     // The TSDU for ethernet.
  35.     //
  36.     kEnetTSDU                    = 1514,
  37.     //
  38.     // The TSDU for TokenRing.
  39.     //
  40.     kTokenRingTSDU                = 4458,
  41.     //
  42.     // The TSDU for FDDI.
  43.     //
  44.     kFDDITSDU                    = 4458, //%%% Until someone tells me different
  45.     
  46.     
  47.     k8022SAPLength                = 1,
  48.     
  49.     //
  50.     // define the length of the header portion of an 802.2 packet.
  51.     //
  52.     k8022BasicHeaderLength        = 3, // = SSAP+DSAP+ControlByte
  53.     k8022SNAPHeaderLength        = k8022SNAPLength + k8022BasicHeaderLength
  54. };
  55.  
  56. /*******************************************************************************
  57. ** Address Types recognized by the Enet DLPI
  58. ********************************************************************************/
  59.  
  60. enum EAddrType
  61. {
  62.     keaStandardAddress=0, keaMulticast, keaBroadcast, keaBadAddress,
  63.     keaRawPacketBit = 0x80000000, keaTimeStampBit = 0x40000000
  64. };
  65.  
  66. /*******************************************************************************
  67. ** Packet Header Structures
  68. ********************************************************************************/
  69.  
  70. struct EnetPacketHeader
  71. {
  72.     UInt8    fDestAddr[k48BitAddrLength];
  73.     UInt8    fSourceAddr[k48BitAddrLength];
  74.     UInt16    fProto;
  75. };
  76.  
  77. typedef struct EnetPacketHeader    EnetPacketHeader;
  78.  
  79. struct T8022Header
  80. {
  81.     UInt8    fDSAP;
  82.     UInt8    fSSAP;
  83.     UInt8    fCtrl;
  84. };
  85.  
  86. typedef struct T8022Header    T8022Header;
  87.  
  88. struct T8022SNAPHeader
  89. {
  90.     UInt8    fDSAP;
  91.     UInt8    fSSAP;
  92.     UInt8    fCtrl;
  93.     UInt8    fSNAP[k8022SNAPLength];
  94. };
  95.  
  96. typedef struct T8022SNAPHeader    T8022SNAPHeader;
  97.  
  98. struct T8022FullPacketHeader
  99. {
  100.     EnetPacketHeader    fEnetPart;
  101.     T8022SNAPHeader        f8022Part;
  102. };
  103.  
  104. typedef struct T8022FullPacketHeader    T8022FullPacketHeader;
  105.  
  106. /*    -------------------------------------------------------------------------
  107.     Define the lengths of the structures above
  108.     ------------------------------------------------------------------------- */
  109. enum
  110. {
  111.     kT8022HeaderLength                = 3,
  112.     kT8022SNAPHeaderLength            = 3 + k8022SNAPLength,
  113.     kT8022FullPacketHeaderLength    = kEnetPacketHeaderLength + kT8022SNAPHeaderLength
  114. };
  115.  
  116. #if PRAGMA_ALIGN_SUPPORTED
  117. #pragma options align=reset
  118. #endif
  119.  
  120. #endif
  121.